@extends('layouts._admin')
@section('title')
    编辑分类
@endsection
@section('content')
        <!-- content -->
<div class="app-content">
    <div ui-butterbar></div>
    <a href class="off-screen-toggle hide" data-toggle="class:off-screen" data-target=".app-aside"></a>
    <div class="app-content-body fade-in-up">
        <!-- COPY the content from "tpl/" -->
        <div class="hbox hbox-auto-xs hbox-auto-sm">
            <div class="col">
                <div class="wrapper-md ng-scope" ng-controller="FormDemoCtrl">
                    <div class="panel panel-default">
                        <div class="panel-heading font-bold">
                            编辑分类
                        </div>
                        <div class="panel-body">
                            @include('shared.errors')

                            <form class="form-horizontal" role="form" method="POST" action="{{ route('admin.category.update',$category->cate_id) }}">
                                {{ csrf_field() }}
                                {{method_field('PATCH')}}

                                <div class="form-group{{ $errors->has('cate_name') ? ' has-error' : '' }}">
                                    <label for="name" class="col-md-4 control-label">Name</label>

                                    <div class="col-md-6">
                                        <input id="name" type="text" class="form-control" name="cate_name" value="{{ $category->cate_name }}">

                                        @if ($errors->has('cate_name'))
                                            <span class="help-block">
                                                    <strong>{{ $errors->first('cate_name') }}</strong>
                                                </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="line line-dashed b-b  pull-in"></div>


                                <div class="form-group{{ $errors->has('cate_sort') ? ' has-error' : '' }}">
                                    <label for="email" class="col-md-4 control-label">Sort</label>

                                    <div class="col-md-6">
                                        <input id="cate_sort" type="text" class="form-control" name="cate_sort" value="{{ $category->cate_sort }}">

                                        @if ($errors->has('cate_sort'))
                                            <span class="help-block">
                                        <strong>{{ $errors->first('cate_sort') }}</strong>
                                    </span>
                                        @endif
                                    </div>
                                </div>

                                <div class="line line-dashed b-b  pull-in"></div>

                                <div class="form-group">
                                    <div class="col-md-6 col-md-offset-4">
                                        <button type="submit" class="btn btn-primary">
                                            保存
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@section('js')
    <script type="text/javascript" src="{{asset('resources/assets/style/js/style.js')}}"></script>
@endsection